import { createNamespacedHelpers } from 'vuex'
const { mapState: mapPermissionState } = createNamespacedHelpers('permission')
// 该对象可以定义组件内的所有选项
export default {
  computed: {
    ...mapPermissionState(['point'])
  },
  methods: {
    // 控制按钮权限
    isDisabled(val) {
      // const arr = ['point-user-delete', 'POINT-USER-UPDATE', 'POINT-USER-ADD']
      const point = this.$store.state.user.userInfo.roles.points
      // console.log(val)
      // console.log(point.includes(val))
      // point 包含 val 有 返回 false
      return !point.includes(val)
    }
  }
}
